if (!SetCommState (comport, &tio)) {
GPS_Serial_Error("SetCommState");
CloseHandle(comport);
+ comport = INVALID_HANDLE_VALUE;
gps_errno = SERIAL_ERROR;
return 0;
}
if (!SetCommTimeouts (comport, &timeout)) {
GPS_Serial_Error("SetCommTimeouts");
CloseHandle (comport);
+ comport = INVALID_HANDLE_VALUE;
gps_errno = SERIAL_ERROR;
return 0;
}
gusb_close(port);
} else {
CloseHandle(comport);
+ comport = INVALID_HANDLE_VALUE;
}
return 1;
}